from hashlib import md5


def md5_file(file) -> str:
    m = md5()
    with open(file, 'rb') as f:
        m.update(f.read())
    return m.hexdigest()
